home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / amos / amoslist-0295.lzh / AMOSLIST / text0235.txt < prev    next >
Encoding:
Text File  |  1995-03-01  |  1.7 KB  |  70 lines

  1. > I'm having some trouble with AMOS and the manual doesn't seem to
  2. > explain  this.  Basically, I'm trying to write program code like this:
  3. > IF blah=blah
  4. >  blah
  5. >  blah
  6. >  IF blah=blah
  7. >   blah
  8. >   GOSUB blah
  9. >   GOTO blah
  10. >  ENDIF
  11. >  IF blah=blah
  12. >   blah
  13. >   GOSUB blah
  14. >   GOTO blah
  15. >  ENDIF
  16. > ENDIF
  17. > I've put the relevant stuff in capitals to make it easier to read.
  18. > I have a lot of structures like or similar to this.  AMOS, unfortunately, 
  19. > doesn't seem to like having IF THEN ENDIF statements inside of other IF 
  20. > THEN ENDIF's.  This is a pretty big problem because I really need to be 
  21. > able to use this kind of logic.  When I try to run it (or just plain test  it, it
  22. > tests before it runs), it'll tell me that I need a THEN statement  after the
  23. > IF.  If I put that THEN statement in there, it tells me that I  don't need an
  24. > ENDIF since there's no IF!  Apparently if you try
  25. > IF blah=blah THEN
  26. >  etc.
  27. >  IF blah=blah THEN
  28. >   etc.
  29. >  ENDIF
  30. > ENDIF
  31. > it thinks that the first line is self-contained in the sense that the  second
  32. > line, etc, is not inside the IF THEN statement started in the  first line.  If I
  33. > do this
  34. > SUB1:
  35. >  IF blah=blah
  36. >   gosub SUB2
  37. >  ENDIF
  38. >  GOTO blah
  39. > SUB2:
  40. >  IF blah=blah
  41. >   blah
  42. >  ENDIF
  43. >  RETURN 
  44. > it doesn't give me errors.  Doing this, though, is a real pain and makes  it
  45. > harder to follow what's going on (especially if you have four or five 
  46. > nested IF THEN ENDIF's for example).  Can anyone suggest something?
  47. >  How  can I get it to stop doing this?  Please help!  Thanks in advance,
  48. > Andrew
  49.  
  50. You have to use the THEN statement when embedding conditionals ie
  51.  
  52. If A=B
  53.    If b=c Then c=d Endif
  54. Endif
  55.  
  56. -Jedon
  57.  
  58.  
  59.  
  60.